import { createRouter, createWebHashHistory } from 'vue-router'
import home from "../views/home/index.vue";
import login from '../views/home/login.vue'
const routes = [
    {
        path: '/',
        component: home,
    },
    {
        path: '/login',
        name: 'login',
        component: login,
    },
    {
        path: '/manage',
        name:'manage',
        redirect:'/manage/list',
        component: () => import('../views/manage/index.vue'),
        children:[
            {
                path: 'list',
                name:'list',
                component: () => import('../views/manage/list.vue'),
            },
            {
                path: 'star',
                name:'star',
                component: () => import('../views/manage/star.vue'),
            },
            {
                path: 'trash',
                name:'trash',
                component: () => import('../views/manage/trash.vue'),
            },
        ]
    },
    {
        path: '/question',
        name:'question',
        redirect:'/question/edit',
        component: () => import('../views/question/index.vue'),
        children:[
            {
                path: 'edit/:id',
                name:'edit',
                component: () => import('../views/question/edit.vue'),
            },
            {
                path: 'stat/:id',
                name:'stat',
                component: () => import('../views/question/stat.vue'),
            },
        ]
    },
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router
